import * as CONSTANTS from "@/constants/index";
import * as TYPES from "./types";

const initState: TYPES.iCommonState = {
  token: ''
};

const commonState = (state = initState, action: TYPES.tSetTokenAction): TYPES.iCommonState => {
  switch (action.type) {
    case CONSTANTS.ACTION_SETTOKEN: {
      return {
        ...state,
        ...action.payload
      }
    }

    default:
      return state
  }
}

export default commonState;